package com.example.androidpattern.observer.classes;

import android.util.Log;

import com.example.androidpattern.observer.interfaces.Observer;
import com.example.androidpattern.observer.interfaces.Subject;

/**
 * @ClassName: ObserverA$
 * @Description: java类作用描述
 * @Author: xinya
 * @CreateDate: 2020/11/10$ 14:52$
 * @UpdateRemark: 更新内容
 * @Version: 1.0
 */
public class ObserverA implements Observer {
    private static final String TAG = "ObserverA";

    public ObserverA() {
    }

    @Override
    public void update(String msg) {
        Log.d(TAG, "update: " + msg);
    }


    public void registerSubject(Subject subject) {
        subject.registerObserver(this);
    }

    public void unregisterSubject(Subject subject) {
        subject.unregisterObserver(this);
    }
}
